package cn.math.appmath.biz.impl;

import java.util.List;

import cn.math.appmath.bean.TrenderBean;
import cn.math.appmath.biz.TrenderBiz;
import cn.math.appmath.dao.TrenderDao;
import cn.math.appmath.entity.Trender;

public class TrenderBizImpl implements TrenderBiz {
	private TrenderDao trenderDao;
	
	public boolean delete(Integer[] ids) {
		return this.trenderDao.batchDelete(ids);
	}

	public TrenderBean findAll(int page, String param) {
		if(param.equals("forward")){
			page = page - 2;
		}
		return trenderDao.findAll(page);
	}

	public Trender getById(Integer id) {
		return trenderDao.findById(id);
	}

	public boolean save(Trender trender) {
		return trenderDao.save(trender);
	}

	public void update(Trender trender) {
		// TODO Auto-generated method stub

	}

	public void setTrenderDao(TrenderDao trenderDao) {
		this.trenderDao = trenderDao;
	}
	
	public List<Trender> findTop(){
		return trenderDao.findTop();
	}

}
